﻿var core = coreModel();
function coreModel() {
    var c = {},
        toptime;

    c.init = function () {
        $("footer").load("/module/foot.html");
    }

    c.kv = function () {
        var ul = $("#kv > ul");
        ul.width(ul.children("li").length * ul.children("li").width());
        var mySwiper = new Swiper('#kv', { speed: 500, loop: true });
    }

    c.top = function () {
        var ul = $("#top > ul"),
            li = ul.children("li"),
            num = 0;
        ul.height(li.length * li.height());
        toptime = setInterval(function () {
            var tmp = li.eq(num);
            ul.transition({ y: "-=" + (li.height() * 1.75) }, 260, function () {
                num++;
                if (num + 6 == li.length) {
                    ul.transit({ y: 0 }, 10);
                    num = 0;
                }
            });
        }, 2000);
    }
    return c;
}